export default {
    props: {
        text: String
    },
    data () {
        return {
            item: {
                name: '张三',
                age: 28,
                works: '前端、后端、设计、产品'
            },
            list: ['a', 'b', 'c']
        }
    },
    methods: {
        getSlot (name, data) {
            if (this.$scopedSlots[name]) {
                return this.$scopedSlots[name](data);
            } else if (this.$slots[name]) {
                return this.$slots[name];
            }

            return undefined;
        },
    },
    render (h) {
        return h('div', [
                h('h4', this.text),
                this.getSlot('header'),
                this.$slots.default,
                this.getSlot('footer'),
                this.getSlot('item', this.item),
                this.getSlot('list', {list: this.list}),
            ]
        )
    }
}